﻿using System;
public class AlarmClock
{
    private int hour;
    private int minute;
    private int second;
    public event Action Alarm;
    public event Action Tick;
    public void InitializeTime(int hour, int minute, int second)
    {
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }
    public void InitializeEvent()
    {
        Alarm +=  () => { Console.WriteLine("Alarming!! : "+ DateTime.Now.Hour+
            ": "+ DateTime.Now.Minute+": "+ DateTime.Now.Second); };
        Tick += () => { Console.WriteLine("Tick. : "); };

    }


    public void Start()
    {
    while (true)
        {
            System.Threading.Thread.Sleep(500);
            Tick();
            if (hour == DateTime.Now.Hour && minute == DateTime.Now.Minute && second == DateTime.Now.Second)
            {
                Alarm();
            }
        }
    }
}
public class Program
{
    public static void Main()
    {

        Action tick = () => { };
        AlarmClock alarmClock = new AlarmClock();
        alarmClock.InitializeEvent();
        alarmClock.InitializeTime(20, 13, 30);
        alarmClock.Start();
    }
}